/*    */ package com.chb.weblog.test;
/*    */ 
/*    */ import java.util.ArrayList;
/*    */ import java.util.Date;
/*    */ import java.util.List;
/*    */ 
/*    */ class AccessLog
/*    */ {
/* 68 */   private List<List<Date>> accessLogs = new ArrayList();
/* 69 */   private List<Date> thisAccess = new ArrayList();
/* 70 */   private long cha = 60000L;
/*    */ 
/*    */   public void put(Date date) {
/* 73 */     int size = this.thisAccess.size();
/* 74 */     if (size == 0) {
/* 75 */       this.thisAccess.add(date);
/* 76 */       return;
/*    */     }
/*    */ 
/* 79 */     long lastAccessTime = ((Date)this.thisAccess.get(size)).getTime();
/* 80 */     long thisAccessTime = date.getTime();
/* 81 */     if (thisAccessTime - lastAccessTime > this.cha) {
/* 82 */       this.accessLogs.add(this.thisAccess);
/* 83 */       this.thisAccess = new ArrayList();
/* 84 */       this.thisAccess.add(date);
/*    */     } else {
/* 86 */       this.thisAccess.add(date);
/*    */     }
/*    */   }
/*    */ 
/*    */   public List<List<Date>> getAccessLogs() {
/* 91 */     return this.accessLogs;
/*    */   }
/*    */ }

/* Location:           H:\我的资料\Hadoop学习\hive\Hive视频教程\资料\day4\项目代码\step-3-运行预处理\weblog.jar
 * Qualified Name:     cn.itcast.bigdate.test.AccessLog
 * JD-Core Version:    0.6.2
 */